#import "MelancholyDiligentController.h"
        
#import "MelancholyDiligentModel.h"
#import "MelancholyDiligentCell.h"
#import "Masonry.h"

@interface MelancholyDiligentController () <UICollectionViewDataSource, UICollectionViewDelegate>

@property (nonatomic, strong) UICollectionView *tranquilityCollectionView;
@property (nonatomic, strong) NSMutableArray *hopeDreamscapeDatas;

@end

@implementation MelancholyDiligentController

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
}

- (void)viewDidLoad {
    [super viewDidLoad];

    [self crispConfiglayout];
	[self flourishCuriousloadData];
}


//: 获取数据模型
- (void)flourishCuriousloadData {
	
}

//: 懒加载数据模型数组
- (NSMutableArray *)hopeDreamscapeDatas {
	if (!_hopeDreamscapeDatas) {
		_hopeDreamscapeDatas = [NSMutableArray array];
	}
	return _hopeDreamscapeDatas;
}

- (void)crispConfiglayout {
    UICollectionViewFlowLayout *eclipseCrisp = [[UICollectionViewFlowLayout alloc] init];
    eclipseCrisp.minimumLineSpacing = 10;
    eclipseCrisp.minimumInteritemSpacing = 10;
    eclipseCrisp.itemSize = CGSizeMake(100, 100);
    eclipseCrisp.scrollDirection = UICollectionViewScrollDirectionVertical;
    
    self.tranquilityCollectionView = [[UICollectionView alloc] initWithFrame:self.view.bounds collectionViewLayout:eclipseCrisp];
    self.tranquilityCollectionView.backgroundColor = UIColor.clearColor;
    self.tranquilityCollectionView.delegate = self;
    self.tranquilityCollectionView.dataSource = self;
    self.tranquilityCollectionView.showsHorizontalScrollIndicator = NO;
    self.tranquilityCollectionView.showsVerticalScrollIndicator = NO;
    [self.tranquilityCollectionView registerClass:[MelancholyDiligentCell class] forCellWithReuseIdentifier:NSStringFromClass([MelancholyDiligentCell class])];
    
    [self.view addSubview:self.tranquilityCollectionView];
    [self.tranquilityCollectionView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(self.view);
    }];
}

#pragma mark - UICollectionView DataSource
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
    return self.hopeDreamscapeDatas.count;
}

- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
    MelancholyDiligentCell *ideal = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([MelancholyDiligentCell class]) forIndexPath:indexPath];
    return ideal;
}

#pragma mark - UICollectionView Delegate
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
    //: collectioncell 点击
}


@end
